#include<bits/stdc++.h>
using namespace std;
char s[105];
bool vis[105];
double f[105];
double ask(int n){
	if(!n)return 0;
	if(vis[n])return f[n];
	vis[n]=1;
	int flagc=1,flagn=1;
	for(int i=1;i<=n;i++)
		if(s[i]!='C')flagc=0;
	for(int i=1;i<=n;i++)
		if(s[i]!='N')flagn=0;
	if(flagc)return f[n]=n;
	if(flagn)return f[n]=-n;
	double l=-1e9,r=1e9;
	for(int i=1;i<=n;i++)
		if(s[i]=='C')l=max(l,ask(i-1));
		else r=min(r,ask(i-1));
	return f[n]=(l+r)/2;
}
double g[105];
signed main(){
	cin>>s+1;
	int n=strlen(s+1);
	ask(n);
	for(int i=1;i<=n;i++)
		printf("%d=%.6lf\n",i,f[i]);
	printf("\n");
	return 0;
}

